import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: localStorage.getItem("token") || ""
  },
  getters: {
  },
  mutations: {
    setToken(state, n) { //设置token
      state.token = n
    },
    removeToken() { //删除token
      localStorage.removeItem("token")
    }
  },
  actions: {
  },
  modules: {
  }
})
